<template>
  <div>
    <div style="position: relative;margin: 20px;">
        <h2>售后列表</h2>
        <div style="position: absolute;right: 10px;top:-10px">
            <el-button @click="apply(2)" type="primary">申请售后</el-button>
        </div>
    </div>
    <el-divider></el-divider>
    <el-table
      :data="tableData"
      stripe
      style="width: 100%">
      <el-table-column
        prop="id"
        label="售后编号"
        width="150">
      </el-table-column>
      <el-table-column
        prop="name"
        label="售后标题"
        width="150">
      </el-table-column>
      <el-table-column
        prop="category"
        label="服务分类"
        width="100">
      </el-table-column>
      <el-table-column
        prop="gname"
        label="关联商品"
        width="150">
      </el-table-column>
      <el-table-column
        prop="oid"
        label="关联订单"
        width="150">
      </el-table-column>
      <el-table-column
        prop="time"
        label="提交时间"
        width="150">
      </el-table-column>
      <el-table-column
        prop="state"
        label="状态"
        width="100">
      </el-table-column>
    <el-table-column
        fixed="right"
        label="操作"
        >
        <template slot-scope="scope">
            <div >
            <el-button @click="handleClick(scope.row)" type="primary" size="small">详情</el-button>
            <el-button @click="handleClick(scope.row)" type="danger" size="small">取消</el-button>
            </div>  
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
    data(){
        return{
            tableData:[
                {
                    id:'1',
                    name:'钢琴踏板损坏',
                    category:'换货',
                    gname:'钢琴',
                    oid:'1',
                    time:'2023/5/1 12:00:00',
                    state:'受理中',

                }
            ]
        }
    },
    methods:{
        handleClick(row){
            console.log(row.oid)
        },
        apply(num){
            this.$emit("getIndex",num)
        }
    }
}
</script>
<style>

</style>
